//
//  AppropriteObject.m
//  Food
//
//  Created by dlios on 15-7-17.
//  Copyright (c) 2015年 李志远. All rights reserved.
//

#import "AppropriteObject.h"

@implementation AppropriteObject

- (void)dealloc
{
    [_name release];
    [_codeId release];
    [_content release];
    [_state release];
    [super dealloc];
}
- (void)setValue:(id)value forUndefinedKey:(NSString *)key
{
    if ([key isEqualToString:@"code"]) {
        self.codeId = [NSString stringWithFormat:@"%@", value];
    }
    else if ([key isEqualToString:@"state"]) {
        self.state = [NSString stringWithFormat:@"%@", value];
    }
}
+ (NSMutableArray *)ClassArrayWithDictionaryArray:(NSArray *)dicArray
{
    NSMutableArray *tempArr = [NSMutableArray array];
    for (NSDictionary *dic in dicArray) {
        
        AppropriteObject *baseClass = [[AppropriteObject alloc] init];
        [baseClass setValuesForKeysWithDictionary:dic];
        [tempArr addObject:baseClass];
        [baseClass release];
    }
    return tempArr;

}

@end
